home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
47215
/
47215.xpi
/
chrome
/
content
/
lib
/
tabs.js
< prev
next >
Wrap
Text File
|
2009-11-22
|
1KB
|
41 lines
(function()
{
//returns the tab context menu
this.tabContextMenu = function()
{
if(!this.getBrowserElement('tabContextMenu'))
return document.getAnonymousElementByAttribute(this.getBrowserElement("content") , "anonid", "tabContextMenu");
else
return this.getBrowserElement('tabContextMenu');
}
//returns a count of tabs
this.tabCount = function()
{
return gBrowser.tabContainer.childNodes.length;
}
//returns a tab from a document-REVIEW
/*
http://forums.mozillazine.org/viewtopic.php?p=3329527#p3329527
document of page = event.originalTarget
window of page = event.originalTarget.defaultView
browser = gBrowser.getBrowserForDocument(event.originalTarget)
tab = gBrowser.mTabs[gBrowser.getBrowserIndexForDocument(event.originalTarget)]
panel = gBrowser.mTabs[gBrowser.getBrowserIndexForDocument(event.originalTarget)].linkedPanel
*/
this.tabGetFromDocument = function(aDoc)
{
return gBrowser.mTabs[gBrowser.getBrowserIndexForDocument(aDoc)]
}
//gets the current URI from aTab-REVIEW
this.tabGetLocation = function(aTab)
{
if(aTab.hasAttribute('permaTabUrl'))
return String(aTab.getAttribute('permaTabUrl'));
else
return String(this.browserGetFromTab(aTab).currentURI.spec);
}
return null;
}).apply(URLtoTabTitle);